<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改菜品信息 - 红高粱</title>
<%@ include file="/WEB-INF/jsp/common/res.jsp"%>
<link href="<c:url value="/scripts/jquery/validate/css/validate.css"/>" rel="stylesheet"/>
<script src="<c:url value="/scripts/jquery/validate/jquery.validate.min.js"/>"></script> 
<script charset="utf-8" src="<c:url value="/widgets/kindeditor/kindeditor.js"/>"></script>
<script charset="utf-8" src="<c:url value="/widgets/kindeditor/lang/zh_CN.js"/>"></script>
<script type="text/javascript" src="<c:url value="/scripts/product/editProduct.js"/>"></script>
<style type="text/css">
#_product{background-color: #0087d8;} 
.text{width:300px;height:20px;color:#666666;}
.menu{text-align:center;padding:4px;padding-right:5px;width: 300px;}
#img{cursor: pointer;}
</style>
</head>
<body>
	<%@ include file="/WEB-INF/jsp/common/header.jsp"%>
	<div class="main_title">
		<div class="main_title2"><span>当前位置：产品管理 &gt; 修改菜品</span></div>
	</div>
	<div class="main_content">
			<div class="main_menu">
				<ul>
					<li>
						<a href="<c:url value="/product/query"/>" style="color:#FFFFFF;">菜品信息</a>
					</li>
					<li><a href="<c:url value="/product/add"/>">添加菜品</a></li>
					<li class="choice"><a href="<c:url value="#"/>">修改菜品</a></li>
				</ul>
			</div>
			<div class="main_list">
				<div style="margin:30px 50px">
					<form action="<c:url value="/product/edit"/>" method="post" id="addProductForm">
						<p>
							<label>菜品名称<span class="red">*</span></label>
							<input type="text" name="productName" class="text" value="${p.productName}" />
						</p>
						
						<p>
							<label>所属店铺<span class="red">*</span></label>
							<select name="categories" class="menu">
								<option value="">---请选择---</option>
								<c:forEach var="m" items="${categories}">
								<option value="${m.cid}" <c:if test="${cid eq m.cid}">selected="selected"</c:if>>${m.name}</option>
								</c:forEach>
							</select>
						</p>
						
						<p>
							<label>所属种类<span class="red">*</span></label>
							<select name="foods" class="menu">
								<option value="">---请选择---</option>
								<c:forEach var="m" items="${foods}">
								<option value="${m.cid}" <c:if test="${fid eq m.cid}">selected="selected"</c:if>>${m.name}</option>
								</c:forEach>
							</select>
						</p>
<!-- 						<p> -->
<!-- 							<label>产品数量</label><br /><input type="text" -->
<!-- 								name="number" class="text" /> -->
<!-- 						</p> -->
						<p>
							<label>产品价格<span class="red">&nbsp;</span></label>
							<input type="text" name="price" class="text"  value="<fmt:formatNumber value="${p.price}" pattern="#.00"/>"/>
						</p>
<!-- 						<p> -->
<!-- 							<label>内容摘要<span class="red">&nbsp;</span></label> -->
<%-- 							<input type="text" name="summary" class="text" value="${p.summary}"/> --%>
<!-- 						</p> -->
						<p>
							<label>封面图片<span class="red">*</span></label>
							<input type="hidden" name="images" id="images" value="${p.images}"/>
							<c:if test="${p.images eq ''}">
								<img src="" style="width:150px;height:auto;display:none;" />
								<input type="button" id="image_upload" style="height:25px;padding-top:2px;" class="btn" value="上传" />
							</c:if>
							<br />
							<c:if test="${p.images != ''}">
								<img src="${p.images}" id="img_display" style="width:150px;height:auto;" />
								<input type="button" id="image_update" style="height:25px;padding-top:2px;" class="btn" value="修改" />
							</c:if>
							(图片大小不能超过1M)
						</p>
						<p>
							<label>描述<span class="red">&nbsp;</span></label><br />
							<textarea style="width:550px;height:400px;" id="description" name="description">${p.description }</textarea>
						</p>
						<p>
							<input type="hidden" name="customerId" id="customerId" value="${customerId }"/>
							<input type="hidden" name="return" value="${returnUrl}"/>
							<input type="hidden" name="id" value="${p.id}"/>
							<input type="submit" value="保存" class="btn" />
							<input type="reset" value="重置" class="btn" />
						</p>
					</form>
				</div>
			</div>
	</div>
</body>
</html>